package com.javakc.copyrightin.chapter.dao;

import com.javakc.commonutils.jpa.base.dao.BaseDao;
import com.javakc.copyrightin.chapter.entity.Chapter;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;


public interface ChapterDao extends BaseDao<Chapter,Integer> {
    @Modifying
    @Query(value = "insert into bms_chapter (id,name,number,update_time,book_id,content,status,bms_create,bms_modified)" +
            " select id,name,number,update_time,book_id,content,status,bms_create,bms_modified from bms_chapter_temp where id=:id"
            ,nativeQuery=true)
    public void insert(@Param("id") Integer id);
}
